package com.canbot.u05.bean.training;


import java.io.Serializable;

/**
 * Created by xh on 2017/12/18.
 */

public class Step implements Serializable {

    public static final String TABLE_NAME = "Step";

    private int id;

    // 图片路径
    private String mPicPath;

    // 音频路径
    private String mAudioPath;

    // 动作 id
    private String mActionId;

    // 音频文件：true       tts：false
    private boolean mIsAudioFile;

    // 对应任务
    private Task mTask;

    private int type;   // 1.mPicPath  2.mAudioPath  3.mActionId

    public Step() {
    }

    public Step(String string,int type) {
        if(type==1){
            this.mPicPath = string;
        }else if(type==2){
            this.mAudioPath = string;
        }else{
            this.mActionId = string;
        }
    }

    public Step(String picPath, String audioPath, String actionId, boolean isAudioFile) {
        this.mPicPath = picPath;
        this.mAudioPath = audioPath;
        this.mActionId = actionId;
        this.mIsAudioFile = isAudioFile;
    }

    public String getPicPath() {
        return mPicPath;
    }

    public void setPicPath(String picPath) {
        this.mPicPath = picPath;
    }

    public String getAudioPath() {
        return mAudioPath;
    }

    public void setAudioPath(String audioPath) {
        this.mAudioPath = audioPath;
    }

    public String getActionId() {
        return mActionId;
    }

    public void setActionId(String actionId) {
        this.mActionId = actionId;
    }

    public boolean isAudioFile() {
        return mIsAudioFile;
    }

    public void setAudioFile(boolean audioFile) {
        mIsAudioFile = audioFile;
    }

    public Task getTask() {
        return mTask;
    }

    public void setTask(Task task) {
        mTask = task;
    }

    public boolean ismIsAudioFile() {
        return mIsAudioFile;
    }

    public void setmIsAudioFile(boolean mIsAudioFile) {
        this.mIsAudioFile = mIsAudioFile;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }else if (this == obj) {
            return true;
        }
        Step step;
        if (obj instanceof Step) {
            step = (Step) obj;
        }else {
            return false;
        }
        return this.id == step.id && this.mPicPath.equals(step.mPicPath) && this.mAudioPath.equals(step.mAudioPath)
                && this.mActionId.equals(step.mActionId) && this.mIsAudioFile == step.mIsAudioFile
                && this.mTask.getName().equals(step.getTask().getName());
    }

    @Override
    public String toString() {
        return "Step{" +
                "id=" + id +
                ", mPicPath='" + mPicPath + '\'' +
                ", mAudioPath='" + mAudioPath + '\'' +
                ", mActionId='" + mActionId + '\'' +
                ", mIsAudioFile=" + mIsAudioFile +
                ", mTask=" + mTask +
                '}';
    }

}
